﻿<UserControl xmlns:PageBar="clr-namespace:Mengsk.ProxyDelivery.App.UI.PageBar"  x:Class="Mengsk.ProxyDelivery.App.UI.Operator.OperatorUserControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="1000" Loaded="UserControl_Loaded">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" Orientation="Horizontal">
            <TextBlock Text="工号：" Margin="3" VerticalAlignment="Center"/>
            <TextBox Name="tbNumber" Margin="3" VerticalAlignment="Center" Width="100"/>
            <TextBlock Text="姓名：" Margin="3" VerticalAlignment="Center"/>
            <TextBox Name="tbName" Margin="3" VerticalAlignment="Center" Width="100"/>
            <TextBlock Text="电话:" Margin="3" VerticalAlignment="Center"/>
            <TextBox Name="tbPhone" Margin="3" VerticalAlignment="Center" Width="100"/>
            <TextBlock Text="仓库:" Margin="3" VerticalAlignment="Center"/>
            <ComboBox Name="cbbWarehouse" Margin="3" VerticalAlignment="Center" Width="100" DisplayMemberPath="Name"/>
            <Button Name="btnSearch" Margin="3" Content="查询" VerticalAlignment="Center" Width="60" Click="btnSearch_Click" FontSize="13"/>
            <Button Name="btnEdit" Margin="3" Content="编辑" VerticalAlignment="Center" Width="60" Click="btnEdit_Click" FontSize="13"/>
            <Button Name="btnAdd" Margin="3" Content="增加" VerticalAlignment="Center" Width="60" Click="btnAdd_Click" FontSize="13"/>
            <Button Name="btnResetPassword" Margin="3" Content="重置密码" VerticalAlignment="Center" Width="60" Click="btnResetPassword_Click" FontSize="13"/>
        </StackPanel>

        <DataGrid Grid.Row="1" Name="dgvOperators" Margin="3" GridLinesVisibility="All" IsReadOnly="True" AutoGenerateColumns="False" >
            <DataGrid.Columns>
                <DataGridTextColumn Header="编号" Binding="{Binding Id}"/>
                <DataGridTextColumn Header="工号" Binding="{Binding Number}"/>
                <DataGridTextColumn Header="姓名" Binding="{Binding Name}"/>
                <DataGridTextColumn Header="仓库" Binding="{Binding Warehouse,Converter={StaticResource warehouseConverter}}"/>
                <DataGridTextColumn Header="电话" Binding="{Binding Phone}"/>
                <DataGridTextColumn Header="状态" Binding="{Binding Enabled,Converter={StaticResource boolConverter},ConverterParameter=禁用|启用}"/>
                <DataGridTextColumn Header="创建时间" Binding="{Binding CreateTime,StringFormat=yyyy-MM-dd HH:mm:ss}"/>
                <DataGridTextColumn Header="更新时间" Binding="{Binding UpdateTime,StringFormat=yyyy-MM-dd HH:mm:ss}"/>
            </DataGrid.Columns>
        </DataGrid>
        <PageBar:PageBarUserControl Grid.Row="2" PageSize="100" x:Name="pbBar" PageChanging="pbBar_PageChanging"/>
    </Grid>
</UserControl>
